<?php
/**
 * Description of RenderMeResponse
 *
 * @author antoine
 */
class RenderMeResponse implements Response {
    /**
     * @var TemplateRenderer
     */
    private $templateRenderer;
    
    /**
     *
     * @var string
     */
    private $template;
    
    /**
     *
     * @var array
     */
    private $vars;
    
    /**
     *
     * @var int
     */
    private $code = 200;
    
    /**
     *
     * @var string
     */
    private $message = 'Ok';
    
    public function output() {
        header("HTTP/1.0 {$this->code} {$this->message}");
        echo $this->templateRenderer->renderTemplate(
                $this->template,
                $this->vars);
    }
    
    /**
     *
     * @return TemplateRenderer
     */
    public function getTemplateRenderer() {
        return $this->templateRenderer;
    }

    /**
     *
     * @param TemplateRenderer $templateRenderer 
     */
    public function setTemplateRenderer(TemplateRenderer $templateRenderer) {
        $this->templateRenderer = $templateRenderer;
    }

    /**
     *
     * @return string
     */
    public function getTemplate() {
        return $this->template;
    }

    /**
     *
     * @param string $template 
     */
    public function setTemplate($template) {
        $this->template = $template;
    }

    /**
     *
     * @return array
     */
    public function getVars() {
        return $this->vars;
    }

    /**
     *
     * @param array $vars 
     */
    public function setVars(array $vars) {
        $this->vars = $vars;
    }

    /**
     *
     * @return int
     */
    public function getCode() {
        return $this->code;
    }

    /**
     *
     * @param int $code 
     */
    public function setCode($code) {
        $this->code = $code;
    }

    /**
     *
     * @return string
     */
    public function getMessage() {
        return $this->message;
    }

    /**
     *
     * @param string $message 
     */
    public function setMessage($message) {
        $this->message = $message;
    }
}
